//
//  DECXUserCenterViewController.m
//  DECXInStore
//
//  Created by 李坤 on 2018/9/10.
//  Copyright © 2018年 程强. All rights reserved.
//

#import "DECXUserCenterViewController.h"
#import "DECXDeliveryListViewController.h"
#import "DECXLoginViewController.h"
#import "TPWalletViewController.h"
#import "DECXSettingViewController.h"

@interface DECXUserCenterViewController ()
@property (weak, nonatomic) IBOutlet UILabel *nameLbl;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *scrollWidth;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *scrollHeight;
@end

@implementation DECXUserCenterViewController
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    if ([DECXGlobal shareInstance].loginStatus) {
        MyUser;
        self.nameLbl.text = user.name;
    }
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.scrollWidth.constant = ScreenWidth;
    self.scrollHeight.constant = ScreenHeight;
    [self setRightBarItem];
}
- (void)setRightBarItem
{
    UIBarButtonItem *item = [[UIBarButtonItem alloc]initWithImage:LoadImage(@"setting_icon") style:UIBarButtonItemStylePlain target:self action:@selector(rightClick)];
    self.navigationItem.rightBarButtonItem = item;
}
- (void)rightClick
{
    DECXSettingViewController *vc = StoryBoardViewController(@"Main", @"DECXSettingViewController");
    [self.navigationController pushViewController:vc animated:YES];
}
- (IBAction)deliveryClick:(id)sender
{
//    if (![[DECXGlobal shareInstance].loginType isEqualToString:@"3"]){
//        ToastShowInWindow(@"您没有提货权限！");
//        return;
//    }
    DECXDeliveryListViewController *vc = StoryBoardViewController(@"Main", @"DECXDeliveryListViewController");
    [self.navigationController pushViewController:vc animated:YES];
}
- (IBAction)myWalletClick:(id)sender
{
    TPWalletViewController *vc = StoryBoardViewController(@"Wallet", @"TPWalletViewController");
    vc.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:vc animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
